package com.zxd.date;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.ZoneId;

/**
 * ClassName:MyDuration
 * Package:com.zxd.newdate
 *
 * @Date:2023/9/18 22:23
 * @Author:zxde
 */
public class MyDuration {
    public static void main(String[] args) {
        LocalDateTime llt1 = LocalDateTime.now(ZoneId.systemDefault());
        LocalDateTime llt2 = LocalDateTime.of(1999,11,14,6,12,23);
        Duration between = Duration.between(llt2, llt1);
        long days = between.toDays(); //间隔天数
        long hours = between.toHours();//间隔小时数
        long minutes = between.toMinutes();//间隔分钟数
        long seconds = between.getSeconds(); //间隔秒数
        int nano = between.getNano(); //不足一秒的纳秒数
        long na = between.toNanos(); //间隔的纳秒数
        //na = seconds + na
        System.out.println("stop");
    }
}
